package demo9.teht;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JApplet;
import javax.swing.JPanel;

/**
 *
 * @author Pasi
 */
public class T4_2KomponenttiAppletti extends JApplet {
    private Image image1,image2;
    private JPanel piirtopaneeli; 
    
    @Override
    public void init() {
        // TODO start asynchronous download of heavy resources
        image1 = getImage(getDocumentBase(),"kuva1.jpg");
        image2 = getImage(getDocumentBase(),"kuva2.jpg");
        piirtopaneeli = new PiirtoPaneeli();
        piirtopaneeli.setLayout(null);
        piirtopaneeli.add(new T4_2Komponentti(image1,200,150,0,0));
        piirtopaneeli.add(new T4_2Komponentti(image2,200,150,300,0));
        getContentPane().add(piirtopaneeli);
    }
    

    // TODO overwrite start(), stop() and destroy() methods
    class PiirtoPaneeli extends JPanel {
        @Override
        public void paintComponent(Graphics g){
            super.paintComponent(g);
        }
    }
}
